package com.sskj.aikeeper.hangqing.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.flyco.tablayout.CommonTabLayout;
import com.flyco.tablayout.listener.CustomTabEntity;
import com.sskj.aikeeper.R;
import com.sskj.aikeeper.presenter.HangqingPresenter;
import com.sskj.common.base.App;
import com.sskj.lib.Constans;
import com.sskj.lib.RConfig;
import com.sskj.lib.base.BaseFragment;
import com.sskj.lib.bean.TabItem;

import java.util.ArrayList;
import java.util.Objects;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * @author Hey
 * Create at  2019/06/25
 */
@Route(path = RConfig.APP_FRAGMENT_HANGQING)
public class HangqingFragment extends BaseFragment<HangqingPresenter> {
    @BindView(R.id.tvTitle)
    TextView tvTitle;
    @BindView(R.id.ivBack)
    LinearLayout ivBack;

    ArrayList<CustomTabEntity> tabEntities = new ArrayList<>();
    ArrayList<Fragment> fragments = new ArrayList<>();
    @BindView(R.id.coin_tab)
    CommonTabLayout coinTab;

    @Override
    public int getLayoutId() {
        return R.layout.app_fragment_hangqing;
    }

    @Override
    public HangqingPresenter getPresenter() {
        return new HangqingPresenter();
    }

    @Override
    public void initView() {
        ivBack.setVisibility(View.GONE);
        tvTitle.setText(App.INSTANCE.getString(R.string.app_hangqingFragment1));
        tabEntities.add(new TabItem("USDT", 0, 0));
        tabEntities.add(new TabItem("AICASH", 0, 0));
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.APP_FRAGMENT_COIN_LIST).withString(Constans.COIN_TYPE, "usdt").navigation());
        fragments.add((Fragment) ARouter.getInstance().build(RConfig.APP_FRAGMENT_COIN_LIST).withString(Constans.COIN_TYPE, "aicash").navigation());
        coinTab.setTabData(tabEntities, Objects.requireNonNull(getActivity()), R.id.home_market, fragments);
    }

    @Override
    public void initData() {

    }
}
